package com.haixee.parkdemo.auth.controller;

import com.haixee.parkdemo.auth.entity.dto.ViewInfoDTO;
import com.haixee.parkdemo.auth.service.ViewService;
import com.haixee.parkdemo.common.response.ResResult;
import com.haixee.parkdemo.common.response.ResUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/view")
public class ViewController {

    @Autowired
    private ViewService viewService;

    @GetMapping
    public ResResult getAll() {

        List<ViewInfoDTO> allView = viewService.getAllView();

        return ResUtil.success(allView);
    }
}
